package com.xiaoshuidi.cloud.module.rooms.controller.admin.roomhousetype;


import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.rooms.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.rooms.pojo.RoomHouseType;
import com.xiaoshuidi.cloud.module.rooms.service.RoomHouseTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 户型信息 前端控制器
 * </p>
 *
 * @author hans.zhang
 * @since 2023-05-09
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@Tag(name = "管理后台 - 户型信息")
@RequestMapping(ApiConstants.NAME + "/roomhousetype")
public class RoomHouseTypeController {

    private final RoomHouseTypeService roomHouseTypeService;

    @Operation(summary = "分页查询")
    @Parameters({
            @Parameter(name = "pageNum", description = "页码"),
            @Parameter(name = "pageSize", description = "每业大小"),
            @Parameter(name = "name", description = "户型名"),
    })
    @GetMapping("/pagelist")
    public CommonResult<PageResult<RoomHouseType>> pageList(@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize,@RequestParam("name") String name){
        return roomHouseTypeService.pageList(pageNum, pageSize, name);
    }
}
